home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
4.2
/
arexx
/
toasterpaint
/
export.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-04-16
|
2KB
|
85 lines
/* Export.rexx V2.0 -- Save A File Using Hiip */
/* © 1995 NewTek, Inc. By Bob Caron (Grue) */
call remlib('rexxsupport.library')
call ADDLIB("rexxsupport.library", 0,-30,0)
if pos('DigiPaint',show(ports))=0 then do
exit
end
options results
if ~exists("hiip:") then address command "c:assign hiip: toaster:programs/hiip_support"
path="hiip:savers"
dir = showdir(path ,'f','*')
test=translate(dir,'?',' ','?')
test2=translate(test,' ','*',' ')
dir = test2
Address "DigiPaint" /* Tell ARexx where commands go */
'Dnam'"Hiip:savers/"
'Fnam'"jpeg"
'Askf' "Format?"
file=result
if lastpos('/',file,length(file)-1)~=0 then do
filenam=right(file,(length(file)-lastpos('/',file,length(file)-1)))
path=left(file,(lastpos('/',file,length(file))-1))
end
else do
filenam=right(file,(length(file)-lastpos(':',file,length(file)-1)))
path=left(file,(lastpos(':',file,length(file))))
end
validsaver=fileisgood(filenam,dir)
if upper(right(filenam,4))=".CAP" then filenam=left(filenam,length(file)-4)
/* OK! So if you dump any weird file in hiip:savers it will attempt to use*/
/* it as a saver! Sigh. Not much I can do about that ;) */
if validsaver=0 then do
'Askb'"That isn't a valid;HIIP Saver!"
exit
end
format=filenam
'Dnam'"Toaster:images"
'Fnam'""
'Askf' "Save As"
file=result
if lastpos('/',file,length(file)-1)~=0 then do
filenam=right(file,(length(file)-lastpos('/',file,length(file)-1)))
path=left(file,(lastpos('/',file,length(file))-1))
end
else do
filenam=right(file,(length(file)-lastpos(':',file,length(file)-1)))
path=left(file,(lastpos(':',file,length(file))))
end
if exists("t:temp") then address command "c:delete t:temp"
'Sa24'
'Fnam'"T:temp" /* Enter File name */
'Okls' /* Hit the OK button */
address command "c:wait 6"
address command "C:gnusto t:temp "||file||" image saver "||format
address command "c:delete t:temp"
exit
fileisgood:
parse arg file,dir
loopto=words(dir)
loop=1
do while (loop<loopto)
if file=word(dir,loop) then return 1
loop=loop+1
end
return 0